
#include <QtCore/QDebug>
#include <QtCore/QSharedMemory>

#include "qt_windows.h"


#include "LcdAudioSwitcherApplication.h"

#define SHARED_MEMORY_SINGLETON		"{F268151C-D463-43B0-B18B-912C974F7D90}"


int main(int argc, char *argv[])
{
	HWND hwnd = GetConsoleWindow();
	ShowWindow(hwnd, 0);

	QSharedMemory sharedMemory(SHARED_MEMORY_SINGLETON);
	if(sharedMemory.create(sizeof(int))==true)
	{
		LcdAudioSwitcherApplication a(argc, argv, "Lcd Audio Switcher");

		if(a.exitCode!=0)
			return a.exitCode;
		int ret = a.exec();
		a.shutdown();
		return ret;
	}
	else
	{
		LcdAudioSwitcherApplication::loadIntoSharedMem("next");
	}
	return 0;
}